
<script type="text/javascript">
	$(document).ready(function(){
      	pageInit();
    });
function pageInit()
{
   // $('#zuanzai').toggle();
	$('#message_write').xheditor({skin:'nostyle',tools:'Bold,Italic,Underline,Strikethrough,About',upImgUrl:httpURL+"/edit/content!updataImage.do",upImgExt:"jpg,jpeg,gif,png"});
	 $('#title_message').val("");
     $('#message_write').val("");
    
//	$('#elm1').xheditor({upLinkUrl:"upload.php",upLinkExt:"zip,rar,txt",upImgUrl:"upload.php",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.php",upFlashExt:"swf",upMediaUrl:"upload.php",upMediaExt:"avi"});
	
}

function submit(){
    var title = $('#title_message').val();
   
    var message = $('#message_write').val();
     var url = $('#url_message').val();
   
    if(''==message){
       alert("没有文章内容");
       return;
    }
   
   // alert(request.QueryString("piccode"));
    $.ajax({
    url:httpURL+"/edit/content!addWenZhang.do",
    type: 'POST',
    data:{title:title,type:0,content:message,fromwhere:url},
    dataType:'json',
    success:function(msg){
       if(msg.msg=="ok"){
        
           $('#title').val("");
           $('#message').val("");
           sd_remove();
           turnPage(1, pageSize);
       }else{
          alert("未登录");
       }
    },
    error:function(){
      //alert("error");
    }
   
    
    });
}
/**

**/
function selectChange(){
  
 $('#zuanzai').toggle();
}
</script>


<table style="width:100%">
	<tr>
		<td style="width:10%"><select class="edit_title_input"
			id="select" name="select" onchange="selectChange()">
				<option value="1">原创</option>
				<option value="2">转载</option>
		</select>
		</td>
		<td><input type='search' class="edit_title_input"
			name="title_message" id="title_message" placeholder='文章标题' /></td>
	</tr>
	<tr id="zuanzai" style="display:none">
		<td colspan="2"><input type='search' class="edit_title_input"
			name="url_message" id="url_message" placeholder='转载路径' /></td>
	</tr>
	<tr>
		<td colspan="2"><textarea id="message_write" name="message_write">
    </textarea></td>
	</tr>
	<tr>

		<td><a href="#" onclick="closeWin()">关闭</a></td>
		<td align="right"><input type="button"
			class="button_edit_submit_cancel" name="save" value="Submit"
			onclick="submit()" /> <input type="button"
			class="button_edit_submit_cancel" name="reset" value="Reset"
			onclick="cancel()" /></td>
	</tr>
</table>





